<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddColumnTypeAndTenantGroupIdInOrder extends AbstractMigration
{
    public function up()
    {
        $this->table('order')
            ->addColumn('type', 'enum', ['values' => 'outside,tenant_group', 'default' => 'outside', 'comment' => '订单类型:outside外部,tenant_group集团'])
            ->addColumn('tenant_group_id', 'integer', ['signed' => false, 'default' => 0, 'limit' => 11, 'comment' => '集团id'])
            ->save();
    }

    public function down()
    {
        $this->table('order')
            ->removeColumn('type')
            ->removeColumn('tenant_group_id')
            ->save();
    }
}
